package chapter8.anonymous;


public class Food {
	//Polymorphism is in play
	Popcorn p =new Popcorn(){
		//On the test you must be able to spot a new method
		public void pop(){
			System.out.println("anonymous popcorn!!!");
			sizzle();
		}
		public void sizzle(){
			System.out.println("anonymous sizzle popcorn");
		}
	};
	
	//{p.}
	//can only implement ONE interface here
	// must implement
	Cookable c = new Cookable(){
		public void cook(){
			System.out.println("anonymous cookable implementer");
		}
		public void cook2(){
			System.out.println("anonymous cookable2 implementer");
		}
	};
	
	public static void main(String[] args){
		Food f = new Food();
		f.p.pop();
		//f.p.sizzle();
		f.c.cook();
		f.c.cook2();
	}
}
